<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>判断密码</title>
</head>
<body>
    <script>
        var input=prompt('请输入你的密码');
        function gu(){
            if(input.length>=6&&input.length<=12){
                alert("密码正确");
            }
             else if (input.length<6){
                alert("密码不能小于6位");
            }
            else{
                alert('密码不能大于12位');
            }
        }
        alert(gu(input));
    </script>
</body>
</html>